<link rel="stylesheet" href="./css/highlight/styles/monokai-sublime.css">
<script src="./css/highlight/highlight.pack.js"></script>
<script type="text/javascript">
  (function($){
    $(function(){
      /*在网页上高亮显示代码*/
      $('pre code').each(function (i, block) {  
        hljs.highlightBlock(block);  
      });

      /*右边栏目滚动事件*/
      $(window).on("scroll",function(){
        var $itemTop = $(".mainCol").offset().top;
        if($itemTop < $(this).scrollTop()){
          $(".sideCol").addClass("fixed");
        }else{
          $(".sideCol").removeClass("fixed");
        }
      });

      /*右边栏目菜单点击事件*/
      $(".title-list .link").on("click",function(){
        var aHash = this.hash;
        $("html,body").animate({scrollTop: $(aHash).offset().top});
        return false;
      });

    });
  })(jQuery);
</script>